<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <meta name="ctx" th:context="${#request.getContextPath()}">
    <script th:src="@{/static/js/jquery-3.3.1.js}"></script>
    <link rel="stylesheet" th:href="@{/static/lib/bootstrap-3.3.7-dist/css/bootstrap.min.css}">
    <script th:src="@{/static/lib/bootstrap-3.3.7-dist/js/bootstrap.min.js}"></script>
    <link rel="stylesheet" th:href="@{/static/css/header.css}">
    <script th:src="@{/static/js/cource/adminAllCource.js}"></script>
    <script th:src="@{/static/js/cource/upload.js}"></script>
    <title>所有的课程</title>
</head>
<body>
<div th:replace="commons/header :: navbar"></div>
<input type="hidden" id="getname" th:value="${session.user.username}">
<div class="container">
    <div class="row">
        <div class="col-md-offset-4">
            <h1>我的课程</h1>
        </div>
    </div>
    <div class="row">
        <div class="col-md-offset-8">
            <button class="btn btn-primary btn-sm" id="add_btn" onclick="toUpload()">添加</button>
            <!--<button class="btn btn-warning btn-sm" id="delete_checked_btn">删除</button>-->
        </div>
    </div>
    <div class="row">
        <div class="col-md-12">
            <table class="table table-hover" id="admin_cource_table">
                <thead>
                <tr>
                    <th>
                        <input type="checkbox" id="check_all"/>
                    </th>
                    <th>#</th>
                    <th>课程名</th>
                    <th>分类</th>
                    <th>二级分类</th>
                    <th>介绍</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>

                </tbody>
            </table>
        </div>
    </div>
    <div class="row">
        <div class="col-sm-offset-6" id="page_nav">

        </div>
    </div>
</div>
<script>
    window.onload = function()
    {
        var ctx = $("meta[name='ctx']").attr("context");
        $.ajax({
            url: ctx + "/cource/getAllCource",
            type: "post",
            success: function (result) {
                build_table(result);
            }
        });
    }
</script>
</body>

</html>